/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package be.ugent.maf.cellmissy.gui.project;

import javax.swing.*;

/**
 * @author Paola Masuzzo <paola.masuzzo@ugent.be>
 */
public class TracksWriterDialog extends javax.swing.JDialog {

    public JButton getDeselectAllButton() {
        return deselectAllButton;
    }

    public JButton getSelectAllButton() {
        return selectAllButton;
    }

    public JButton getChooseDirectoryButton() {
        return chooseDirectoryButton;
    }

    public JButton getComputeAndWriteButton() {
        return computeAndWriteButton;
    }

    public JTextArea getLogTextArea() {
        return logTextArea;
    }

    public JTree getDataTree() {
        return dataTree;
    }

    public JTextField getDirectoryTextField() {
        return directoryTextField;
    }

    /**
     * Creates new form TracksWriterDialog
     *
     * @param parent
     * @param modal
     */
    public TracksWriterDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        userInputPanel = new javax.swing.JPanel();
        dataScrollPane = new javax.swing.JScrollPane();
        dataTree = new javax.swing.JTree();
        computeAndWriteButton = new javax.swing.JButton();
        selectAllButton = new javax.swing.JButton();
        deselectAllButton = new javax.swing.JButton();
        directoryTextField = new javax.swing.JTextField();
        chooseDirectoryButton = new javax.swing.JButton();
        computationsPanel = new javax.swing.JPanel();
        logScrollPane = new javax.swing.JScrollPane();
        logTextArea = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Write cell tracks data to file");
        setMinimumSize(new java.awt.Dimension(950, 750));
        getContentPane().setLayout(new java.awt.GridBagLayout());

        userInputPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Choose Experiments"));
        userInputPanel.setMinimumSize(new java.awt.Dimension(20, 20));
        userInputPanel.setPreferredSize(new java.awt.Dimension(20, 20));

        dataScrollPane.setBorder(null);
        dataScrollPane.setViewportView(dataTree);

        computeAndWriteButton.setText("Compute & Write to File");

        selectAllButton.setText("Select All");

        deselectAllButton.setText("Deselect All");

        directoryTextField.setEditable(false);
        directoryTextField.setEnabled(false);

        chooseDirectoryButton.setText("Choose Directory");

        javax.swing.GroupLayout userInputPanelLayout = new javax.swing.GroupLayout(userInputPanel);
        userInputPanel.setLayout(userInputPanelLayout);
        userInputPanelLayout.setHorizontalGroup(
            userInputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(userInputPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(userInputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(dataScrollPane)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, userInputPanelLayout.createSequentialGroup()
                        .addComponent(directoryTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)
                        .addGap(10, 10, 10)
                        .addGroup(userInputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(chooseDirectoryButton)
                            .addComponent(selectAllButton, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(deselectAllButton)
                            .addComponent(computeAndWriteButton))))
                .addContainerGap())
        );

        userInputPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {chooseDirectoryButton, computeAndWriteButton, deselectAllButton, selectAllButton});

        userInputPanelLayout.setVerticalGroup(
            userInputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(userInputPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(dataScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 461, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(userInputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(directoryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(chooseDirectoryButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(selectAllButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(deselectAllButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(computeAndWriteButton))
        );

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 0.5;
        gridBagConstraints.weighty = 1.0;
        getContentPane().add(userInputPanel, gridBagConstraints);

        computationsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Computations"));
        computationsPanel.setMinimumSize(new java.awt.Dimension(20, 20));
        computationsPanel.setPreferredSize(new java.awt.Dimension(20, 20));

        logScrollPane.setBorder(null);

        logTextArea.setEditable(false);
        logTextArea.setColumns(20);
        logTextArea.setFont(new java.awt.Font("Monospaced", 0, 14)); // NOI18N
        logTextArea.setForeground(new java.awt.Color(0, 51, 204));
        logTextArea.setLineWrap(true);
        logTextArea.setRows(5);
        logScrollPane.setViewportView(logTextArea);

        javax.swing.GroupLayout computationsPanelLayout = new javax.swing.GroupLayout(computationsPanel);
        computationsPanel.setLayout(computationsPanelLayout);
        computationsPanelLayout.setHorizontalGroup(
            computationsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(computationsPanelLayout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addComponent(logScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
                .addGap(16, 16, 16))
        );
        computationsPanelLayout.setVerticalGroup(
            computationsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(computationsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(logScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 583, Short.MAX_VALUE)
                .addGap(12, 12, 12))
        );

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 0.5;
        gridBagConstraints.weighty = 1.0;
        getContentPane().add(computationsPanel, gridBagConstraints);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | UnsupportedLookAndFeelException | IllegalAccessException | InstantiationException ex) {
            java.util.logging.Logger.getLogger(TracksWriterDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                TracksWriterDialog dialog = new TracksWriterDialog(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton chooseDirectoryButton;
    private javax.swing.JPanel computationsPanel;
    private javax.swing.JButton computeAndWriteButton;
    private javax.swing.JScrollPane dataScrollPane;
    private javax.swing.JTree dataTree;
    private javax.swing.JButton deselectAllButton;
    private javax.swing.JTextField directoryTextField;
    private javax.swing.JScrollPane logScrollPane;
    private javax.swing.JTextArea logTextArea;
    private javax.swing.JButton selectAllButton;
    private javax.swing.JPanel userInputPanel;
    // End of variables declaration//GEN-END:variables
}
